package com.vvhard.javaagent;

import java.lang.instrument.Instrumentation;

/**
 * @author zhangqirong
 * @Date 2022/4/4
 */
public class MyAgent02 {

    public static void agentmain(String agentArgs, Instrumentation inst) {
        System.out.println("load agent after main run. args=" + agentArgs);

        Class<?>[] classes = inst.getAllLoadedClasses();
        for (Class<?> cls : classes) {
            System.out.println("agent attach, get class name: " + cls.getName());
        }

        System.out.println("agent run completely");
    }

}
